<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/kernel/qapplication.cpp -->
<head>
  <title>Qt 4.3: Qt 3 Support Members for QApplication</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Qt 3 Support Members for QApplication</h1>
<p><b>The following class members are part of the <a href="qt3support.html">Qt 3 support layer</a>.</b> They are provided to help you port old code to Qt 4. We advise against using them in new code.</p>
<p><ul><li><a href="qapplication.html">QApplication class reference</a></li></ul></p>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>typedef <b><a href="qapplication-qt3.html#ColorMode-typedef">ColorMode</a></b></li>
</ul>
<h3>Static Public Members</h3>
<ul>
<li><div class="fn"/>const int <b><a href="qapplication-qt3.html#CustomColors-var">CustomColors</a></b></li>
<li><div class="fn"/>const int <b><a href="qapplication-qt3.html#NormalColors-var">NormalColors</a></b></li>
<li><div class="fn"/>ColorMode <b><a href="qapplication-qt3.html#colorMode">colorMode</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#flushX">flushX</a></b> ()</li>
<li><div class="fn"/>bool <b><a href="qapplication-qt3.html#hasGlobalMouseTracking">hasGlobalMouseTracking</a></b> ()</li>
<li><div class="fn"/>Qt::Alignment <b><a href="qapplication-qt3.html#horizontalAlignment">horizontalAlignment</a></b> ( Qt::Alignment <i>align</i> )</li>
<li><div class="fn"/>Qt::MacintoshVersion <b><a href="qapplication-qt3.html#macVersion">macVersion</a></b> ()</li>
<li><div class="fn"/>QWidget * <b><a href="qapplication-qt3.html#mainWidget">mainWidget</a></b> ()</li>
<li><div class="fn"/>bool <b><a href="qapplication-qt3.html#reverseLayout">reverseLayout</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setColorMode">setColorMode</a></b> ( ColorMode <i>mode</i> )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setFont-2">setFont</a></b> ( const QFont &amp; <i>font</i>, bool <i>b</i>, const char * <i>className</i> = 0 )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setGlobalMouseTracking">setGlobalMouseTracking</a></b> ( bool <i>dummy</i> )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setMainWidget">setMainWidget</a></b> ( QWidget * <i>mainWidget</i> )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setOverrideCursor-2">setOverrideCursor</a></b> ( const QCursor &amp; <i>cursor</i>, bool <i>replace</i> )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setPalette-2">setPalette</a></b> ( const QPalette &amp; <i>pal</i>, bool <i>b</i>, const char * <i>className</i> = 0 )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setReverseLayout">setReverseLayout</a></b> ( bool <i>reverse</i> )</li>
<li><div class="fn"/>void <b><a href="qapplication-qt3.html#setWinStyleHighlightColor">setWinStyleHighlightColor</a></b> ( const QColor &amp; <i>c</i> )</li>
<li><div class="fn"/>QWidget * <b><a href="qapplication-qt3.html#widgetAt-2">widgetAt</a></b> ( int <i>x</i>, int <i>y</i>, bool <i>child</i> )</li>
<li><div class="fn"/>QWidget * <b><a href="qapplication-qt3.html#widgetAt-3">widgetAt</a></b> ( const QPoint &amp; <i>point</i>, bool <i>child</i> )</li>
<li><div class="fn"/>const QColor &amp; <b><a href="qapplication-qt3.html#winStyleHighlightColor">winStyleHighlightColor</a></b> ()</li>
<li><div class="fn"/>Qt::WindowsVersion <b><a href="qapplication-qt3.html#winVersion">winVersion</a></b> ()</li>
</ul>
<ul>
<li><div class="fn"/>4 static public members inherited from <a href="qcoreapplication.html#static-public-members">QCoreApplication</a></li>
</ul>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="ColorMode-typedef"></a>typedef QApplication::ColorMode</h3>
<p>Use <a href="qapplication.html#ColorSpec-enum">ColorSpec</a> instead.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="colorMode"></a><a href="qapplication-qt3.html#ColorMode-typedef">ColorMode</a> QApplication::colorMode ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qapplication.html#colorSpec">colorSpec</a>() instead, and use <a href="qapplication.html#ColorSpec-enum">ColorSpec</a> as the enum type.</p>
<p>See also <a href="qapplication-qt3.html#setColorMode">setColorMode</a>().</p>
<h3 class="fn"><a name="flushX"></a>void QApplication::flushX ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qcoreapplication.html#flush">flush</a>() instead.</p>
<h3 class="fn"><a name="hasGlobalMouseTracking"></a>bool QApplication::hasGlobalMouseTracking ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This feature does not exist anymore. This function always returns true in Qt 4.</p>
<h3 class="fn"><a name="horizontalAlignment"></a><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a> QApplication::horizontalAlignment ( <a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a> <i>align</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Strips out vertical alignment flags and transforms an alignment <i>align</i> of <a href="qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> into <a href="qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> or <a href="qt.html#AlignmentFlag-enum">Qt::AlignRight</a> according to the language used.</p>
<h3 class="fn"><a name="macVersion"></a><a href="qt-qt3.html#MacintoshVersion-enum">Qt::MacintoshVersion</a> QApplication::macVersion ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qsysinfo.html#MacintoshVersion-var">QSysInfo::MacintoshVersion</a> instead.</p>
<h3 class="fn"><a name="mainWidget"></a><a href="qwidget.html">QWidget</a> * QApplication::mainWidget ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns the main application widget, or 0 if there is no main widget.</p>
<p>See also <a href="qapplication-qt3.html#setMainWidget">setMainWidget</a>().</p>
<h3 class="fn"><a name="reverseLayout"></a>bool QApplication::reverseLayout ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qapplication.html#layoutDirection-prop">layoutDirection</a>() instead.</p>
<p>See also <a href="qapplication-qt3.html#setReverseLayout">setReverseLayout</a>().</p>
<h3 class="fn"><a name="setColorMode"></a>void QApplication::setColorMode ( <a href="qapplication-qt3.html#ColorMode-typedef">ColorMode</a> <i>mode</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qapplication.html#setColorSpec">setColorSpec</a>() instead, and pass a <a href="qapplication.html#ColorSpec-enum">ColorSpec</a> value instead.</p>
<p>See also <a href="qapplication-qt3.html#colorMode">colorMode</a>().</p>
<h3 class="fn"><a name="setFont-2"></a>void QApplication::setFont ( const <a href="qfont.html">QFont</a> &amp; <i>font</i>, bool <i>b</i>, const char * <i>className</i> = 0 )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Use the two-argument overload instead.</p>
<h3 class="fn"><a name="setGlobalMouseTracking"></a>void QApplication::setGlobalMouseTracking ( bool <i>dummy</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This function does nothing in Qt 4. The <i>dummy</i> parameter is ignored.</p>
<p>See also <a href="qapplication-qt3.html#hasGlobalMouseTracking">hasGlobalMouseTracking</a>().</p>
<h3 class="fn"><a name="setMainWidget"></a>void QApplication::setMainWidget ( <a href="qwidget.html">QWidget</a> * <i>mainWidget</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Sets the application's main widget to <i>mainWidget</i>.</p>
<p>In most respects the main widget is like any other widget, except that if it is closed, the application exits. Note that <a href="qapplication.html">QApplication</a> does <i>not</i> take ownership of the <i>mainWidget</i>, so if you create your main widget on the heap you must delete it yourself.</p>
<p>You need not have a main widget; connecting <a href="qapplication.html#lastWindowClosed">lastWindowClosed</a>() to <a href="qcoreapplication.html#quit">quit</a>() is an alternative.</p>
<p>For X11, this function also resizes and moves the main widget according to the <i>-geometry</i> command-line option, so you should set the default geometry (using <a href="qwidget.html#geometry-prop">QWidget::setGeometry</a>()) before calling setMainWidget().</p>
<p>See also <a href="qapplication-qt3.html#mainWidget">mainWidget</a>(), <a href="qapplication.html#exec">exec</a>(), and <a href="qcoreapplication.html#quit">quit</a>().</p>
<h3 class="fn"><a name="setOverrideCursor-2"></a>void QApplication::setOverrideCursor ( const <a href="qcursor.html">QCursor</a> &amp; <i>cursor</i>, bool <i>replace</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Use changeOverrideCursor(<i>cursor</i>) (if <i>replace</i> is true) or setOverrideCursor(<i>cursor</i>) (if <i>replace</i> is false).</p>
<h3 class="fn"><a name="setPalette-2"></a>void QApplication::setPalette ( const <a href="qpalette.html">QPalette</a> &amp; <i>pal</i>, bool <i>b</i>, const char * <i>className</i> = 0 )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Use the two-argument overload instead.</p>
<h3 class="fn"><a name="setReverseLayout"></a>void QApplication::setReverseLayout ( bool <i>reverse</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qapplication.html#layoutDirection-prop">setLayoutDirection</a>() instead.</p>
<p>See also <a href="qapplication-qt3.html#reverseLayout">reverseLayout</a>().</p>
<h3 class="fn"><a name="setWinStyleHighlightColor"></a>void QApplication::setWinStyleHighlightColor ( const <a href="qcolor.html">QColor</a> &amp; <i>c</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use the palette instead.</p>
<p>For example, if you have code like</p>
<pre><font color="#404040"> app.setWinStyleHighlightColor(color);</font></pre>
<p>you can rewrite it as</p>
<pre> QPalette palette(qApp-&gt;palette());
 palette.setColor(QPalette::Highlight, color);
 qApp-&gt;setPalette(palette);</pre>
<p>See also <a href="qapplication-qt3.html#winStyleHighlightColor">winStyleHighlightColor</a>().</p>
<h3 class="fn"><a name="widgetAt-2"></a><a href="qwidget.html">QWidget</a> * QApplication::widgetAt ( int <i>x</i>, int <i>y</i>, bool <i>child</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Use the two-argument <a href="qapplication.html#widgetAt">widgetAt</a>() overload to get the child widget. To get the top-level widget do this:</p>
<pre> QWidget *widget = qApp-&gt;widgetAt(x, y);
 if (widget)
     widget = widget-&gt;window();</pre>
<h3 class="fn"><a name="widgetAt-3"></a><a href="qwidget.html">QWidget</a> * QApplication::widgetAt ( const <a href="qpoint.html">QPoint</a> &amp; <i>point</i>, bool <i>child</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Use the single-argument <a href="qapplication.html#widgetAt">widgetAt</a>() overload to get the child widget. To get the top-level widget do this:</p>
<pre> QWidget *widget = qApp-&gt;widgetAt(point);
 if (widget)
     widget = widget-&gt;window();</pre>
<h3 class="fn"><a name="winStyleHighlightColor"></a>const <a href="qcolor.html">QColor</a> &amp; QApplication::winStyleHighlightColor ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qapplication.html#qApp">qApp</a>-&gt;<a href="qapplication.html#palette">palette</a>().color(<a href="qpalette.html#ColorGroup-enum">QPalette::Active</a>, <a href="qpalette.html#ColorRole-enum">QPalette::Highlight</a>) instead.</p>
<p>See also <a href="qapplication-qt3.html#setWinStyleHighlightColor">setWinStyleHighlightColor</a>().</p>
<h3 class="fn"><a name="winVersion"></a><a href="qt-qt3.html#WindowsVersion-enum">Qt::WindowsVersion</a> QApplication::winVersion ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Use <a href="qsysinfo.html#WindowsVersion-var">QSysInfo::WindowsVersion</a> instead.</p>
<hr />
<h2>Member Variable Documentation</h2>
<h3 class="fn"><a name="CustomColors-var"></a>const int QApplication::CustomColors</h3>
<p>Use <a href="qapplication.html#ColorSpec-enum">CustomColor</a> instead.</p>
<h3 class="fn"><a name="NormalColors-var"></a>const int QApplication::NormalColors</h3>
<p>Use <a href="qapplication.html#ColorSpec-enum">NormalColor</a> instead.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
